﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;

namespace Model
{
    public class Pager
    {
        public Pager()
        {

        }

        private string _tableName;

        public string TableName
        {
            get { return _tableName; }
            set { _tableName = value; }
        }

        private string _primaryKey;

        public string PrimaryKey
        {
            get { return _primaryKey; }
            set { _primaryKey = value; }
        }

        private string _showFields = " * ";

        public string ShowFields
        {
            get { return _showFields; }
            set { _showFields = value; }
        }

        private int _pageSize;

        public int PageSize
        {
            get { return _pageSize; }
            set { _pageSize = value; }
        }

        private int _pageIndex;

        public int PageIndex
        {
            get { return _pageIndex; }
            set { _pageIndex = value; }
        }

        public string For { get; set; }

        private string _orderFid = null;

        /// <summary>
        /// 默认按主键排序升序，格式： AF desc , BF ASC
        /// </summary>

        public string OrderFid
        {
            get { return _orderFid; }
            set { _orderFid = value; }
        }


        private string _autoOrder = "";

        /// <summary>
        /// 系统自动排序
        /// </summary>

        public string AutoOrder
        {
            get { return _autoOrder; }
            set { _autoOrder = value; }
        }

        private string _strWhere = " 1= 1";


        public string StrWhere
        {
            get { return _strWhere; }
            set { _strWhere = value; }
        }

        private bool _isReadDbSource = true;

        /// <summary>
        /// 是否读取数据数据源，默认为true
        /// </summary>

        public bool IsReadDbSource
        {
            get { return _isReadDbSource; }
            set { _isReadDbSource = value; }
        }

        private string _autoWhere;

        public string AutoWhere
        {
            get { return _autoWhere; }
            set { _autoWhere = value; }
        }

        private string _pageName;

        public string PageName
        {
            get { return _pageName; }
            set { _pageName = value; }
        }

        private string _filterAppName;

        /// <summary>
        /// 如果设置了该字段，则业务逻辑层自动会加入该字段的公司限制
        /// </summary>
        public string FilterAppName
        {
            get { return _filterAppName; }
            set { _filterAppName = value; }
        }

        private string _comcode;

        public string Comcode
        {
            get { return _comcode; }
            set { _comcode = value; }
        }

        private string _usercode;

        public string Usercode
        {
            get { return _usercode; }
            set { _usercode = value; }
        }
    }
}
